package com.sg.controller.bff;

import com.sg.service.biz.bff.GridCalculateService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "GridCalculate", tags = {"GridCalculate"})
@RestController
// @RequestMapping("/oms/gridCalculate/")
public class GridCalculateController {

    @Autowired
    GridCalculateService gridCalculateService;

    /**
     * B3-提交汇报任务
     * gen by moon at 6/1/2023, 7:53:38 PM
     */
    @PostMapping("/oms/gridCalculate/commitReportTask")
    @ApiOperation(value = "B3-提交汇报任务", response = OkrResult.class)
    public OkrResult<BffCommitReportTaskRespDto> commitReportTask(@RequestBody(required = false) @Validated BffCommitReportTaskReqDto reqDTO) {
        return OkrResult.success(gridCalculateService.commitReportTask(reqDTO));
    }

    /**
     * B3-审核通过汇报任务
     * gen by moon at 6/1/2023, 8:06:30 PM
     */
    @PostMapping("/oms/gridCalculate/approveSucceedReportTask")
    @ApiOperation(value = "B3-审核通过汇报任务", response = OkrResult.class)
    public OkrResult<BffApproveSucceedReportTaskRespDto> approveSucceedReportTask(@RequestBody(required = false) @Validated BffApproveSucceedReportTaskReqDto reqDTO) {
        return OkrResult.success(gridCalculateService.approveSucceedReportTask(reqDTO));
    }

    /**
     * B3-执行全模板内容计算
     * gen by moon at 6/13/2023, 9:57:25 PM
     */
    @PostMapping("/oms/gridCalculate/implementCalcEvaTempAllContentDatas")
    @ApiOperation(value = "B3-执行全模板内容计算", response = OkrResult.class)
    public OkrResult<BffImplementCalcEvaTempAllContentDatasRespDto> implementCalcEvaTempAllContentDatas(@RequestBody(required = false) @Validated BffImplementCalcEvaTempAllContentDatasReqDto reqDTO) {
        return OkrResult.success(gridCalculateService.implementCalcEvaTempAllContentDatas(reqDTO));
    }

    /**
     * B3-执行全模版标准数据重新计算
     * gen by moon at 6/13/2023, 9:57:34 PM
     */
    @PostMapping("/oms/gridCalculate/implementRecalcAllStandardData")
    @ApiOperation(value = "B3-执行全模版标准数据重新计算", response = OkrResult.class)
    public OkrResult<BffImplementRecalcAllStandardDataRespDto> implementRecalcAllStandardData(@RequestBody(required = false) @Validated BffImplementRecalcAllStandardDataReqDto reqDTO) {
        return OkrResult.success(gridCalculateService.implementRecalcAllStandardData(reqDTO));
    }
}
